import { request } from '@/utils/http'


export const postLogin = (data ?: any) => {
	return request.post('/User/login', data, {
		contentType: 'application/x-www-form-urlencoded',
		showLoading: true
	})
}
export const postRefreshToken = async (data ?: any) => {
	console.log('开始刷新Token请求', data)
	return await request.post('/User/refresh-token', data, {
			contentType: 'application/x-www-form-urlencoded',
			showLoading: false
		})
}

export const getProfileSummary = (data ?: any) => {
	return request.get('/User/profile-summary', data,{
		showLoading: false
	})
}
export const postEditUser= (data?: any) => {
	return request.post('/User/edit-user', data,{
		showLoading: false
	})
}
export const postLogout= (data?: any) => {
	return request.post('/User/logout', data,{
		showLoading: false
	})
}
export const postThirdLogin= (data?: any) => {
	return request.post('/User/third-login', data,{
		contentType: 'application/x-www-form-urlencoded',
		showLoading: true
	})
}

export const getUser = (data?: any) => {
	return request.get('/User/user', data,{
		showLoading: false
	})
}
